<%@ page import="martial.arts.tracker.Account" %>



<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'accountId', 'error')} required">
	<label for="accountId">
		<g:message code="account.accountId.label" default="Account Id" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="accountId" required="" value="${fieldValue(bean: accountInstance, field: 'accountId')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'lastName', 'error')} ">
	<label for="lastName">
		<g:message code="account.lastName.label" default="Last Name" />
		
	</label>
	<g:textField name="lastName" value="${accountInstance?.lastName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'firstName', 'error')} ">
	<label for="firstName">
		<g:message code="account.firstName.label" default="First Name" />
		
	</label>
	<g:textField name="firstName" value="${accountInstance?.firstName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'street', 'error')} ">
	<label for="street">
		<g:message code="account.street.label" default="Street" />
		
	</label>
	<g:textField name="street" value="${accountInstance?.street}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'city', 'error')} ">
	<label for="city">
		<g:message code="account.city.label" default="City" />
		
	</label>
	<g:textField name="city" value="${accountInstance?.city}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'state', 'error')} ">
	<label for="state">
		<g:message code="account.state.label" default="State" />
		
	</label>
	<g:textField name="state" value="${accountInstance?.state}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'zip', 'error')} required">
	<label for="zip">
		<g:message code="account.zip.label" default="Zip" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="zip" required="" value="${fieldValue(bean: accountInstance, field: 'zip')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'email', 'error')} ">
	<label for="email">
		<g:message code="account.email.label" default="Email" />
		
	</label>
	<g:textField name="email" value="${accountInstance?.email}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'payments', 'error')} ">
	<label for="payments">
		<g:message code="account.payments.label" default="Payments" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${accountInstance?.payments?}" var="p">
    <li><g:link controller="payment" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="payment" action="create" params="['account.id': accountInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'payment.label', default: 'Payment')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: accountInstance, field: 'students', 'error')} ">
	<label for="students">
		<g:message code="account.students.label" default="Students" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${accountInstance?.students?}" var="s">
    <li><g:link controller="student" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="student" action="create" params="['account.id': accountInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'student.label', default: 'Student')])}</g:link>
</li>
</ul>

</div>

